package com.yhp.web;

import com.yhp.bean.Grade;
import com.yhp.bean.Role;
import com.yhp.service.impl.RoleServiceImpl;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/power/user/RoleList")
public class RoleListServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        RoleServiceImpl service = new RoleServiceImpl();
        List<Role> list = service.getList();
        req.setAttribute("rlist", list);
        req.getRequestDispatcher("add.jsp").forward(req, resp);
    }

}
